package com.medical.medical.mapper;

import com.medical.medical.entity.WorkForces;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Update;

import java.util.List;

/**
 * @authorDesc 诸神在上，佑我程序，玄功护体，BUG皆去！
 * @author LiSuYang
 * @Date 2022-09-14 09:39:52
 * @version 1.0.0
 * @description 排班表-数据访问层
 */
public interface WorkForcesMapper {
    List<WorkForces> getWordByKidAndDid(Integer workforcesDepartment, Integer workforcesDoctor);

    /**
     * 根据科室id查询总条数
     * @param workforcesDepartment
     * @return
     */
    int getWorkCount(Integer workforcesDepartment);

    /**
     * 根据科室id查询排班信息，并分页
     * @param workforcesDepartment
     * @param start
     * @param pageSize
     * @return
     */
    List<WorkForces> getWorkList(@Param("workforcesDepartment") Integer workforcesDepartment,
                                 @Param("start")int start,
                                 @Param("pageSize")int pageSize);

    /**
     * 根据医生姓名和科室id查询医生个人的排班信息
     * @param workforcesDoctor
     * @param workforcesDepartment
     * @return
     */
    List<WorkForces> getWorkBydName(@Param("workforcesDoctor") Integer workforcesDoctor,
                                    @Param("workforcesDepartment")Integer workforcesDepartment);


     /**
      *@author WangLuDong
      *@Description 方法描述 剩余号数 - 1
      *@Date 2022-09-19 12:11:00
       * @param egistration
      *@Return {@link null}
      */
    int modifyEgistration(int egistration);

     /**
      *@author WangLuDong
      *@Description 方法描述 根据医生id获取剩余号数
      *@Date 2022-09-19 12:06:41
       * @param workforcesDoctor
      *@Return {@link null}
      */
    Integer getEgiestration(int workforcesDoctor);

     /**
      *@author WangLuDong
      *@Description 方法描述 初始化剩余号数=最大号数
      *@Date 2022-09-19 14:41:21
       * @param maxRegistration
      *@Return {@link null}
      */
    boolean initEgistration(int maxRegistration);
}
